package sh.wn36.vehiclemanage.service.service_cjl.impl_cjl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import sh.wn36.vehiclemanage.entity.MaintainRecord;
import sh.wn36.vehiclemanage.entity.entity_cjl.Maintain;
import sh.wn36.vehiclemanage.entity.entity_cjl.Violation;
import sh.wn36.vehiclemanage.mapper.mapper_cjl.MaintainRecordMapper;
import sh.wn36.vehiclemanage.mapper.mapper_cjl.PeccancyRecordMapper;
import sh.wn36.vehiclemanage.service.service_cjl.MaintainRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xk
 * @since 2021-04-26
 */
@Service
public class MaintainRecordServiceImpl extends ServiceImpl<MaintainRecordMapper, MaintainRecord> implements MaintainRecordService {

    @Autowired
    private MaintainRecordMapper maintainRecordMapper;

    @Override
    public IPage<Maintain> listMaintainByPage(Page<Maintain> page, QueryWrapper<Maintain> wrapper) {
        IPage<Maintain> maintains = maintainRecordMapper.listMaintain(page,wrapper);
        return maintains;
    }

    @Override
    public List<Maintain> listMaintainRecord() {
        List<Maintain> maintainRecords = maintainRecordMapper.listMaintainRecord();
        return maintainRecords;
    }

    @Override
    public List<Map<String, Object>> reportList() {
        return maintainRecordMapper.reportList();
    }

    @Override
    public List<Map<String, Object>> queryReportByCarId(Integer carId) {
        return maintainRecordMapper.queryReportByCarId(carId);
    }
}
